Skip to content

menubar: стилизация, сторисы#160

Open
khaliulin wants to merge 36 commits into
storybook-updatefrom
menu.Menubar
Open

menubar: стилизация, сторисы#160
khaliulin wants to merge 36 commits into
storybook-updatefrom
menu.Menubar

Conversation

@khaliulin
Copy link
Copy Markdown
Collaborator

No description provided.

@khaliulin khaliulin requested a review from Skosov March 20, 2026 11:53
Danil Khaliulin and others added 2 commits March 20, 2026 22:56
@Skosov
Copy link
Copy Markdown
Member

Skosov commented Mar 25, 2026

image Обрезается пример

@khaliulin
Copy link
Copy Markdown
Collaborator Author

@Skosov фикс высоты превью: 825acdd

Comment thread src/plugins/prime/theme3.0/css.ts Outdated
Comment thread .storybook/preview-head.html Outdated
Comment thread .storybook/preview-head.html Outdated
Comment thread src/plugins/prime/stories/Menu/MenuBar/MenuBar.template.js Outdated
Comment thread src/plugins/prime/stories/Menu/MenuBar/MenuBar.template.js Outdated
Comment thread src/plugins/prime/theme3.0/css.ts Outdated
<script setup lang="ts">
import { Badge } from 'primevue';

defineProps({
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Я так понимаю этот компонент сделан просто как пример чтобы заюзать в сторизе

Image

Но у нас же в фигме буквально отрисован ItemTemplate и я так понимаю это какой то стандартный кстом

Может его нормально типизировать, наверстать в соответсвии с представленным макетом и экспрортировать для использования? Вопрос к обсжудению, я не сильно настаиваю

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

меню бар в обертку, с простоым прокидыванием всего
МенюБарИтем наверстываем и тоже экспортироваем

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Имеет смысл сразу вынести МенюАйтем для переиспользования в остальных местах, если оно ложится

После Айтем использовать как слот в базовом компоненте

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


defineProps({
item: {
type: Object,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

непонятно что передавать, типизируй через тс

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Skosov фикс 3bfd84f

Вынесен переиспользуемый PBlockMenuItem с TS-типизацией
для использования через #item слот в любых меню-компонентах.
Создан PBlockMenubar по аналогии с PBlockTieredMenu.
Удалён старый MenubarItem.vue из stories.
</script>

<template>
<a v-bind="actionProps" class="p-menuitem-link">
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Давай чтобы стили не конфликтвоали с праймом не будем испрользовать их классы

можем через p-block например писать и конкретно тут уже описать стили для кастом компонента scoped стилями

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Skosov menubar: заменить p-menuitem классы на p-block-menuitem, scoped стили 745d384

<Description />

```javascript
import { Menubar } from 'primevue';
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Импорт не из прайма тут

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Skosov исправлено — импорт PBlockMenubar, PBlockMenuItem из @cdek-it/vue-ui-kit 9eb4cb5


<script setup>
import { ref } from 'vue';
import { PBlockMenubar } from '@/primeBlocks';
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Импорт не из @/primeBlocks, а из кита

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Skosov исправлено — импорт из @cdek-it/vue-ui-kit 9eb4cb5


<script setup>
import { ref } from 'vue';
import { PBlockMenubar, PBlockMenuItem } from '@/primeBlocks';
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

кривой импорт

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Skosov исправлено — импорт из @cdek-it/vue-ui-kit 9eb4cb5

<template v-if="$slots.end" #end>
<slot name="end" />
</template>
<template v-if="$slots.item" #item="slotProps">
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

по умолчанию пусть в слот передается новый PBlockMenuItem

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Skosov по умолчанию в item слоте рендерится PBlockMenuItem 9eb4cb5

description?: string;
badge?: string;
};
actionProps?: Record<string, unknown>;
Copy link
Copy Markdown
Member

@Skosov Skosov May 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

я не понимаю что принимает actionProps, если это атрибуты с a тега, то их не надо передавать как пропс, они должны наследоваться от a

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Skosov убран actionProps — атрибуты наследуются через $attrs 9eb4cb5

template: `
<PBlockMenubar :model="items" v-bind="args">
<template #item="{ item, props, hasSubmenu }">
<PBlockMenuItem :item="item" v-bind="props.action" :has-submenu="hasSubmenu" />
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

для чего тут описывается слот, если PBlockMenuItem должен рисоваться сразу под капотом?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Skosov убран слот — PBlockMenuItem рендерится под капотом по умолчанию 2b649b9

<slot name="item" v-bind="slotProps">
<PBlockMenuItem
:item="slotProps.item"
:has-submenu="slotProps.hasSubmenu"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

has-submenu кажется должен вычисляться по наличию items у основного элемента

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Skosov hasSubmenu теперь computed из item.items — проп убран 0687732

Comment thread src/primeBlocks/PBlockMenuItem/PBlockMenuItem.vue
Comment thread src/primeBlocks/PBlockMenubar/PBlockMenubar.vue
color: ${dt('menubar.extend.extSubmenuLabel.color')};
}

.p-menubar-mobile-button-icon {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

какой-то интересный селектор, откуда он?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Skosov убран селектор .p-menubar-mobile-button-icon 0687732

Comment thread src/plugins/prime/stories/Menu/MenuBar/MenuBar.stories.js
Danil Khaliulin and others added 17 commits May 8, 2026 14:48
Comment thread src/primeBlocks/PBlockMenuItem/PBlockMenuItem.vue Outdated
Comment thread src/plugins/prime/stories/Menu/MenuBar/MenuBar.stories.js
Copy link
Copy Markdown
Collaborator

@anatoly-rodin anatoly-rodin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Вопросы свои закрыл.
Апрув.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants